home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / dev / gui / gtlayout.lha / Source / LTP_Memory.c < prev    next >
C/C++ Source or Header  |  1999-01-02  |  735b  |  46 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1999 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. #include "Assert.h"
  15.  
  16.  
  17. /*****************************************************************************/
  18.  
  19.  
  20. APTR
  21. LTP_Alloc(LayoutHandle *handle,ULONG amount)
  22. {
  23.     APTR result;
  24.  
  25.     if(amount > 0)
  26.         result = AsmAllocPooled(handle->Pool,amount,SysBase);
  27.     else
  28.         result = NULL;
  29.  
  30.     if(!result)
  31.         handle->Failed = TRUE;
  32.  
  33.     return(result);
  34. }
  35.  
  36.  
  37. /*****************************************************************************/
  38.  
  39.  
  40. VOID
  41. LTP_Free(LayoutHandle *handle,APTR mem,ULONG memsize)
  42. {
  43.     if(mem && memsize > 0)
  44.         AsmFreePooled(handle->Pool,mem,memsize,SysBase);
  45. }
  46.